package com.sysu.simulation.fragments.sim;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.sysu.simulation.BaseFragment;
import com.sysu.simulation.MainActivity;
import com.sysu.simulation.R;
import com.sysu.simulation.SimFragment;


public class SimSubmitFragment extends BaseFragment{
    private OnSimSubmitListener mListener;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if(getParentFragment() instanceof OnSimSubmitListener) {
            mListener = (OnSimSubmitListener) getParentFragment();
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnSimSubmitListener");
        }
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_sim_empty;
    }

    @Override
    protected void initWidget(View root) {
        super.initWidget(root);
        TextView t = (TextView) root.findViewById(R.id.big_hint);
        t.setText("正在提交...");
    }

    @Override
    public void onResume() {
        super.onResume();
        if(mListener!=null) {
            mListener.onSimSubmit();
        }
    }

    public interface OnSimSubmitListener {
        void onSimSubmit();
    }
}
